﻿CREATE PROCEDURE [dbo].[GetHoursByConsultant]
@uid INT, @startDate DATETIME, @endDate DATETIME
AS
select sum(Duration) as Hours,Name as ProjectName,UserName from EntryLog e, Projects p, Users u
where EntryDate >= @startDate and EntryDate <= @endDate  and e.projectid=p.projectid and e.userid = u.userid and e.userid=@uid
group by p.Name,u.UserName
order by p.Name


